package com.asiainfo.argumentResolver;

import com.asiainfo.annotation.Service;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;

/**
 * 处理Request请求参数
 */
@Service("argumentResolverRequest")
public class ArgumentResolverRequest implements IArgumentResolver {

    @Override
    public boolean support(Class<?> type, int paramIndex, Method method)
    {
        return ServletRequest.class.isAssignableFrom(type);
    }

    @Override
    public Object argumentResolver(HttpServletRequest request, HttpServletResponse response, Class<?> type, int paramIndex, Method method)
    {
        return request;
    }
}
